//
//  BHPayManager.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/8/30.
//

import UIKit

class BHPayManager {
    func begainBuy(orderText: String,handler: ((Bool,String) -> Void)?)  {
        AlipaySDK.defaultService()?.payOrder(orderText, fromScheme: String.appScheme, callback: { (response) in
            let code = BHJsonTool.hashDecoderString(dic: response, key: "resultStatus")
            if code == "9000" {
                handler?(true,"支付成功")
            }else {
                let errorMsg = BHJsonTool.hashDecoderString(dic: response, key: "memo")
                handler?(false,errorMsg)
            }
        })
    }
}
